package com.yq.order.ocr;

import com.baidu.aip.ocr.AipOcr;

/**
 * Created by yinqi on 2018/9/1.
 */
public class AipOcrManager {

    //设置APPID/AK/SK
//    public static final String APP_ID = "11759411";
//    public static final String API_KEY = "SQvGLMbgdB8H2VIcWn5Lrhhx";
//    public static final String SECRET_KEY = "CyXsTMkIPTwny4vmXBPR7lVQpFC38f0G";
    public static final String APP_ID = "11760803";
    public static final String API_KEY = "U6FFeimPpf1qdt1U264RzLOe";
    public static final String SECRET_KEY = "qCOmP0z4ialcZ9WpUNKN8zwvCVRiWEYc";

    private volatile static AipOcr client = null;

    public static AipOcr getAipOcrInstance() {
        if (null == client) {
            synchronized (AipOcrManager.class) {
                if (null == client) {
                    client = new AipOcr(APP_ID, API_KEY, SECRET_KEY);
                    // 可选：设置网络连接参数
                    client.setConnectionTimeoutInMillis(2000);
                    client.setSocketTimeoutInMillis(60000);
                }

            }
        }
        return client;
    }
}
